<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <title>hello vue.js</title>
    <!--<script src="../js/vue.js"></script>-->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>


    </style>
</head>
<body>
<h1>hello vue.js</h1>

<div id="app">
    {{message}}

    <!--数据绑定-->
  <span v-bind:title="message">
    鼠标悬停几秒钟查看此处动态绑定的提示信息！
  </span>
</div>


<div id="app-7">
    <ol>
        <todo-item v-for="item in groceryList"
        v-bind:todo="item"
        v-bind:key="item.id">
        </todo-item>
    </ol>
</div>

<script>
    new Vue({
        el: "#app",
        data: {
            message: "hello Vue"
        }
    })

    Vue.component('todo-item',{
        props:['todo'],
        template:'<li>{{todo.text}}</li>'
    })

    var app7 = new Vue({
        el: "#app-7",
        data: {
            groceryList: [
                {id:0,text:'蔬菜'},
                {id:1,text:'奶酪'},
                {id:2,text:'随便吃的东西'}
            ]
        }
    })


</script>


</body>
</html>